﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Interfleet.SE.UICompiler.Core
{
    /// <summary>
    /// This class compiles by running a process on the local computer
    /// </summary>
    /// <seealso cref="Arguments"/>
    /// <seealso cref="ArgumentBuilder"/>
    /// <seealso cref="ResultBuilder"/>
    /// <seealso cref="CompilerAgent"/>
    /// <seealso cref="IProcessStartInfoBuilder"/>
    public abstract class ProcessCompilerAgent : CompilerAgent
    {
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="arguments"><see cref="Arguments"/> for compilation</param>
        /// <param name="argumentBuilder">An instance of <see cref="ArgumentBuilder"/></param>
        /// <param name="resultBuilder">An instance of <see cref="ResultBuilder"/></param>
        /// <param name="startInfoBuilder">A <see cref="IProcessStartInfoBuilder"/>, containing
        /// information for the process to be started</param>
        public ProcessCompilerAgent(
            Arguments arguments, 
            ArgumentBuilder argumentBuilder,
            ResultBuilder resultBuilder,
            IProcessStartInfoBuilder startInfoBuilder)
            : base(arguments, argumentBuilder, resultBuilder)
        {
            if (startInfoBuilder == null)
            {
                throw new ArgumentNullException("startInfoBuilder");
            }
            StartInfoBuilder = startInfoBuilder;
        }

        /// <summary>
        /// Start info for the process to be started.
        /// </summary>
        protected IProcessStartInfoBuilder StartInfoBuilder
        {
            get;
            private set;
        }
    }
}
